﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace SLLottery.Controls
{
    public class RecordIDConverter:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            string ReturnStr = value.ToString();
            switch (value.ToString())
            {
                case "-1":
                    ReturnStr= "本页合计";
                    break;
                case "-2":
                    ReturnStr = "总合计";
                    break;
                default:
                    ReturnStr = value.ToString();
                    break;
            }

            return ReturnStr;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            //string strValue = value.ToString();
            //DateTime resultDateTime;
            //if (DateTime.TryParse(strValue, out resultDateTime))
            //{
            //    return resultDateTime;
            //}
            return value;
        }
    }

}
